package com.exercise;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class Test2 {

    public static void main(String[] args){
        //Attribute attribute = new Attribute();
        //测试multipleAdd的效率
        /*int range = 1000000;
        int times = 10000;
        int percentRange = 10;
        Random rand = new Random();
        Map<Integer,Integer> map = new HashMap<>();
        for(int i = 1; i < 31;i ++){
            int randN = rand.nextInt(range);
            map.put(i,randN);
        }
        Attribute attribute = AttributeUtil.getAttributeByMap(map);

        long startTime = System.currentTimeMillis();
        for(int i = 0;i < times;i ++) {
            int percent = rand.nextInt(percentRange);
            // attribute.multipleAdd(percent);
            Attribute attrPercent = AttributeUtil.getAttributeByPercent(percent);
            attribute.percentGet(attrPercent);
        }
        long endTime = System.currentTimeMillis();

        System.out.println("用时"+(endTime - startTime));*/

    }
}
